function windowBase(){

	/*
	 * Call necessary functions onLoad
	 */
	resizeWindow();
	blogFunctions();
	getCurrentBlogEntries();
	caseFunctions();
	getCurrentCases();
	mediaFunctions();
	getCurrentMedia();
	
	/*
	 * Show / Hide hidden Menu Items
	 */
	//$("#mainMenu").bind("mouseover", function(){
	//	$(".hiddenMenuItem").fadeIn("fast");
	//});
	//$("#mainMenu").bind("mouseleave", function(){
	//	$(".hiddenMenuItem").fadeOut("slow");
	//});
	
	/*
	 * Show / Hide Login Window
	 */
	$("#loginButton").bind("click", function(){
		$("#loginWindow").fadeIn("slow");		
	});
	$("#loginAbort").bind("click", function(){
		$("#loginWindow").fadeOut("fast");		
	});
	 
	/*
	 * Erase Login Credentials on focus
	 */
	$(".loginField").bind("focus", function(){
		this.value = "";		
	});
	
	/*
	 * Validate Login Information
	 */
	$("#loginForm").submit(function() {
      if ($("#loginUsername").val() == "" || $("#loginUsername").val() == " ") {
        alert("Please enter your username!");
        return false;
      }
	   if ($("#loginPassword").val() == "" || $("#loginPassword").val() == " ") {
        alert("Please enter your password!");
        return false;
      }
    });
	
	/*
	 * Logout User (Destroy Session)
	 */
	$("#logoutButton").bind("click", function(){
		self.location.href='logout.php';		
	});
	// $("#logoutButton").wTooltip({content: $("#helpText1").text()});
		
	/*
	 * Library
	 */
	$("#menuLibrary").bind("click", function(){
		self.location.href='library.php';
	});
	
	/*
	 * Main Portal
	 */
	$("#userName").bind("click", function(){
		self.location.href='portalMain.php';
	});
	
	/*
	 * reportView
	 */
	$("#reportView").bind("click", function(){
		self.location.href='reportView.php';
	});
}

function resizeWindow(){
	
	/*
	 * Get Browser Window Data
	 */
	if (window.innerHeight){
		// Standard Browser Height
		var height = window.innerHeight;
	} else {
		// Internet Explorer "standardconform mode" Height
		var height = document.documentElement.clientHeight;
	}
	
	if (window.innerWidth){
		// Standard Browser Height
		var width = window.innerWidth;
	} else {
		// Internet Explorer "standardconform mode" Height
		var width = document.documentElement.clientWidth;
	}
	
	/*
	 * Resize Element mainMenu
	 */
	var menu = document.getElementById("mainMenu");
	menu.style.left = "0";
	menu.style.top = "0";
	menu.style.width = width + "px";
	
	$("#mainMenu").corner("bottom");
	
	/*
	 * Resize Element Blog
	 */
	var blogfield = document.getElementById("portalBlog");
	// 100% -35px;
	blogfield.style.height = height - 35 + "px";
	
	/*
	 * Resize Element Case
	 */
	var casefield = document.getElementById("portalCases");
	var halfHeight = (height / 2);
	var float2 = parseFloat(halfHeight).toFixed(0);
	// alert(float2);
	casefield.style.height = float2 - 35 + "px";
	
	/*
	 * Resize Element Media
	 */
	var mediafield = document.getElementById("portalMedia");
	var halfHeight = (height / 2);
	var float2 = parseFloat(halfHeight).toFixed(0);
	// alert(float2);
	mediafield.style.height = float2 - 1 + "px";
}
